// $ANTLR 3.4 VSLParser.g 2011-12-05 14:43:26

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class VSLParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ASCII", "ASSIGN_KW", "COM", "COMMENT", "DIGIT", "DIV", "DO_KW", "ELSE_KW", "FI_KW", "FUNC_KW", "IDENT", "IF_KW", "INTEGER", "INT_KW", "LB", "LC", "LETTER", "LP", "MINUS", "MUL", "OD_KW", "PLUS", "PRINT_KW", "PROTO_KW", "RB", "RC", "READ_KW", "RETURN_KW", "RP", "TEXT", "THEN_KW", "VOID_KW", "WHILE_KW", "WS", "ARDECL", "ARELEM", "ARRAY", "BLOCK", "BODY", "DECL", "FCALL", "FCALL_S", "INST", "PARAM", "PROG"
    };

    public static final int EOF=-1;
    public static final int ASCII=4;
    public static final int ASSIGN_KW=5;
    public static final int COM=6;
    public static final int COMMENT=7;
    public static final int DIGIT=8;
    public static final int DIV=9;
    public static final int DO_KW=10;
    public static final int ELSE_KW=11;
    public static final int FI_KW=12;
    public static final int FUNC_KW=13;
    public static final int IDENT=14;
    public static final int IF_KW=15;
    public static final int INTEGER=16;
    public static final int INT_KW=17;
    public static final int LB=18;
    public static final int LC=19;
    public static final int LETTER=20;
    public static final int LP=21;
    public static final int MINUS=22;
    public static final int MUL=23;
    public static final int OD_KW=24;
    public static final int PLUS=25;
    public static final int PRINT_KW=26;
    public static final int PROTO_KW=27;
    public static final int RB=28;
    public static final int RC=29;
    public static final int READ_KW=30;
    public static final int RETURN_KW=31;
    public static final int RP=32;
    public static final int TEXT=33;
    public static final int THEN_KW=34;
    public static final int VOID_KW=35;
    public static final int WHILE_KW=36;
    public static final int WS=37;
    public static final int ARDECL=38;
    public static final int ARELEM=39;
    public static final int ARRAY=40;
    public static final int BLOCK=41;
    public static final int BODY=42;
    public static final int DECL=43;
    public static final int FCALL=44;
    public static final int FCALL_S=45;
    public static final int INST=46;
    public static final int PARAM=47;
    public static final int PROG=48;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public VSLParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public VSLParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

protected TreeAdaptor adaptor = new CommonTreeAdaptor();

public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}
    public String[] getTokenNames() { return VSLParser.tokenNames; }
    public String getGrammarFileName() { return "VSLParser.g"; }


    public static class program_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "program"
    // VSLParser.g:16:1: program : ( unit )+ -> ^( PROG ( unit )+ ) ;
    public final VSLParser.program_return program() throws RecognitionException {
        VSLParser.program_return retval = new VSLParser.program_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        VSLParser.unit_return unit1 =null;


        RewriteRuleSubtreeStream stream_unit=new RewriteRuleSubtreeStream(adaptor,"rule unit");
        try {
            // VSLParser.g:16:9: ( ( unit )+ -> ^( PROG ( unit )+ ) )
            // VSLParser.g:16:11: ( unit )+
            {
            // VSLParser.g:16:11: ( unit )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==FUNC_KW||LA1_0==PROTO_KW) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // VSLParser.g:16:11: unit
            	    {
            	    pushFollow(FOLLOW_unit_in_program98);
            	    unit1=unit();

            	    state._fsp--;

            	    stream_unit.add(unit1.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            // AST REWRITE
            // elements: unit
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 16:17: -> ^( PROG ( unit )+ )
            {
                // VSLParser.g:16:20: ^( PROG ( unit )+ )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(PROG, "PROG")
                , root_1);

                if ( !(stream_unit.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_unit.hasNext() ) {
                    adaptor.addChild(root_1, stream_unit.nextTree());

                }
                stream_unit.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "program"


    public static class unit_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "unit"
    // VSLParser.g:19:1: unit : ( function | proto );
    public final VSLParser.unit_return unit() throws RecognitionException {
        VSLParser.unit_return retval = new VSLParser.unit_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        VSLParser.function_return function2 =null;

        VSLParser.proto_return proto3 =null;



        try {
            // VSLParser.g:19:6: ( function | proto )
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==FUNC_KW) ) {
                alt2=1;
            }
            else if ( (LA2_0==PROTO_KW) ) {
                alt2=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;

            }
            switch (alt2) {
                case 1 :
                    // VSLParser.g:19:8: function
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_function_in_unit121);
                    function2=function();

                    state._fsp--;

                    adaptor.addChild(root_0, function2.getTree());

                    }
                    break;
                case 2 :
                    // VSLParser.g:20:7: proto
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_proto_in_unit129);
                    proto3=proto();

                    state._fsp--;

                    adaptor.addChild(root_0, proto3.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "unit"


    public static class function_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "function"
    // VSLParser.g:23:1: function : FUNC_KW type IDENT LP param_list RP statement -> ^( FUNC_KW type IDENT param_list ^( BODY statement ) ) ;
    public final VSLParser.function_return function() throws RecognitionException {
        VSLParser.function_return retval = new VSLParser.function_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token FUNC_KW4=null;
        Token IDENT6=null;
        Token LP7=null;
        Token RP9=null;
        VSLParser.type_return type5 =null;

        VSLParser.param_list_return param_list8 =null;

        VSLParser.statement_return statement10 =null;


        CommonTree FUNC_KW4_tree=null;
        CommonTree IDENT6_tree=null;
        CommonTree LP7_tree=null;
        CommonTree RP9_tree=null;
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_RP=new RewriteRuleTokenStream(adaptor,"token RP");
        RewriteRuleTokenStream stream_FUNC_KW=new RewriteRuleTokenStream(adaptor,"token FUNC_KW");
        RewriteRuleTokenStream stream_LP=new RewriteRuleTokenStream(adaptor,"token LP");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
        RewriteRuleSubtreeStream stream_param_list=new RewriteRuleSubtreeStream(adaptor,"rule param_list");
        try {
            // VSLParser.g:23:10: ( FUNC_KW type IDENT LP param_list RP statement -> ^( FUNC_KW type IDENT param_list ^( BODY statement ) ) )
            // VSLParser.g:23:12: FUNC_KW type IDENT LP param_list RP statement
            {
            FUNC_KW4=(Token)match(input,FUNC_KW,FOLLOW_FUNC_KW_in_function142);  
            stream_FUNC_KW.add(FUNC_KW4);


            pushFollow(FOLLOW_type_in_function144);
            type5=type();

            state._fsp--;

            stream_type.add(type5.getTree());

            IDENT6=(Token)match(input,IDENT,FOLLOW_IDENT_in_function146);  
            stream_IDENT.add(IDENT6);


            LP7=(Token)match(input,LP,FOLLOW_LP_in_function148);  
            stream_LP.add(LP7);


            pushFollow(FOLLOW_param_list_in_function150);
            param_list8=param_list();

            state._fsp--;

            stream_param_list.add(param_list8.getTree());

            RP9=(Token)match(input,RP,FOLLOW_RP_in_function152);  
            stream_RP.add(RP9);


            pushFollow(FOLLOW_statement_in_function154);
            statement10=statement();

            state._fsp--;

            stream_statement.add(statement10.getTree());

            // AST REWRITE
            // elements: IDENT, statement, FUNC_KW, type, param_list
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 23:58: -> ^( FUNC_KW type IDENT param_list ^( BODY statement ) )
            {
                // VSLParser.g:23:61: ^( FUNC_KW type IDENT param_list ^( BODY statement ) )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                stream_FUNC_KW.nextNode()
                , root_1);

                adaptor.addChild(root_1, stream_type.nextTree());

                adaptor.addChild(root_1, 
                stream_IDENT.nextNode()
                );

                adaptor.addChild(root_1, stream_param_list.nextTree());

                // VSLParser.g:23:94: ^( BODY statement )
                {
                CommonTree root_2 = (CommonTree)adaptor.nil();
                root_2 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(BODY, "BODY")
                , root_2);

                adaptor.addChild(root_2, stream_statement.nextTree());

                adaptor.addChild(root_1, root_2);
                }

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "function"


    public static class proto_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "proto"
    // VSLParser.g:26:1: proto : PROTO_KW ^ type IDENT LP ! param_list RP !;
    public final VSLParser.proto_return proto() throws RecognitionException {
        VSLParser.proto_return retval = new VSLParser.proto_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token PROTO_KW11=null;
        Token IDENT13=null;
        Token LP14=null;
        Token RP16=null;
        VSLParser.type_return type12 =null;

        VSLParser.param_list_return param_list15 =null;


        CommonTree PROTO_KW11_tree=null;
        CommonTree IDENT13_tree=null;
        CommonTree LP14_tree=null;
        CommonTree RP16_tree=null;

        try {
            // VSLParser.g:26:7: ( PROTO_KW ^ type IDENT LP ! param_list RP !)
            // VSLParser.g:26:9: PROTO_KW ^ type IDENT LP ! param_list RP !
            {
            root_0 = (CommonTree)adaptor.nil();


            PROTO_KW11=(Token)match(input,PROTO_KW,FOLLOW_PROTO_KW_in_proto186); 
            PROTO_KW11_tree = 
            (CommonTree)adaptor.create(PROTO_KW11)
            ;
            root_0 = (CommonTree)adaptor.becomeRoot(PROTO_KW11_tree, root_0);


            pushFollow(FOLLOW_type_in_proto189);
            type12=type();

            state._fsp--;

            adaptor.addChild(root_0, type12.getTree());

            IDENT13=(Token)match(input,IDENT,FOLLOW_IDENT_in_proto191); 
            IDENT13_tree = 
            (CommonTree)adaptor.create(IDENT13)
            ;
            adaptor.addChild(root_0, IDENT13_tree);


            LP14=(Token)match(input,LP,FOLLOW_LP_in_proto193); 

            pushFollow(FOLLOW_param_list_in_proto196);
            param_list15=param_list();

            state._fsp--;

            adaptor.addChild(root_0, param_list15.getTree());

            RP16=(Token)match(input,RP,FOLLOW_RP_in_proto198); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "proto"


    public static class type_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "type"
    // VSLParser.g:29:1: type : ( INT_KW ^| VOID_KW ^);
    public final VSLParser.type_return type() throws RecognitionException {
        VSLParser.type_return retval = new VSLParser.type_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token INT_KW17=null;
        Token VOID_KW18=null;

        CommonTree INT_KW17_tree=null;
        CommonTree VOID_KW18_tree=null;

        try {
            // VSLParser.g:29:6: ( INT_KW ^| VOID_KW ^)
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==INT_KW) ) {
                alt3=1;
            }
            else if ( (LA3_0==VOID_KW) ) {
                alt3=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 3, 0, input);

                throw nvae;

            }
            switch (alt3) {
                case 1 :
                    // VSLParser.g:29:8: INT_KW ^
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    INT_KW17=(Token)match(input,INT_KW,FOLLOW_INT_KW_in_type212); 
                    INT_KW17_tree = 
                    (CommonTree)adaptor.create(INT_KW17)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(INT_KW17_tree, root_0);


                    }
                    break;
                case 2 :
                    // VSLParser.g:30:7: VOID_KW ^
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    VOID_KW18=(Token)match(input,VOID_KW,FOLLOW_VOID_KW_in_type222); 
                    VOID_KW18_tree = 
                    (CommonTree)adaptor.create(VOID_KW18)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(VOID_KW18_tree, root_0);


                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "type"


    public static class param_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "param_list"
    // VSLParser.g:33:1: param_list : ( param ( COM param )* -> ^( PARAM ( param )* ) | -> ^( PARAM ) );
    public final VSLParser.param_list_return param_list() throws RecognitionException {
        VSLParser.param_list_return retval = new VSLParser.param_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COM20=null;
        VSLParser.param_return param19 =null;

        VSLParser.param_return param21 =null;


        CommonTree COM20_tree=null;
        RewriteRuleTokenStream stream_COM=new RewriteRuleTokenStream(adaptor,"token COM");
        RewriteRuleSubtreeStream stream_param=new RewriteRuleSubtreeStream(adaptor,"rule param");
        try {
            // VSLParser.g:33:12: ( param ( COM param )* -> ^( PARAM ( param )* ) | -> ^( PARAM ) )
            int alt5=2;
            int LA5_0 = input.LA(1);

            if ( (LA5_0==IDENT) ) {
                alt5=1;
            }
            else if ( (LA5_0==RP) ) {
                alt5=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;

            }
            switch (alt5) {
                case 1 :
                    // VSLParser.g:33:14: param ( COM param )*
                    {
                    pushFollow(FOLLOW_param_in_param_list236);
                    param19=param();

                    state._fsp--;

                    stream_param.add(param19.getTree());

                    // VSLParser.g:33:20: ( COM param )*
                    loop4:
                    do {
                        int alt4=2;
                        int LA4_0 = input.LA(1);

                        if ( (LA4_0==COM) ) {
                            alt4=1;
                        }


                        switch (alt4) {
                    	case 1 :
                    	    // VSLParser.g:33:21: COM param
                    	    {
                    	    COM20=(Token)match(input,COM,FOLLOW_COM_in_param_list239);  
                    	    stream_COM.add(COM20);


                    	    pushFollow(FOLLOW_param_in_param_list241);
                    	    param21=param();

                    	    state._fsp--;

                    	    stream_param.add(param21.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop4;
                        }
                    } while (true);


                    // AST REWRITE
                    // elements: param
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 33:33: -> ^( PARAM ( param )* )
                    {
                        // VSLParser.g:33:36: ^( PARAM ( param )* )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(PARAM, "PARAM")
                        , root_1);

                        // VSLParser.g:33:44: ( param )*
                        while ( stream_param.hasNext() ) {
                            adaptor.addChild(root_1, stream_param.nextTree());

                        }
                        stream_param.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // VSLParser.g:34:7: 
                    {
                    // AST REWRITE
                    // elements: 
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 34:7: -> ^( PARAM )
                    {
                        // VSLParser.g:34:10: ^( PARAM )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(PARAM, "PARAM")
                        , root_1);

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "param_list"


    public static class param_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "param"
    // VSLParser.g:37:1: param : ( IDENT | IDENT LB RB -> ^( ARRAY IDENT ) );
    public final VSLParser.param_return param() throws RecognitionException {
        VSLParser.param_return retval = new VSLParser.param_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENT22=null;
        Token IDENT23=null;
        Token LB24=null;
        Token RB25=null;

        CommonTree IDENT22_tree=null;
        CommonTree IDENT23_tree=null;
        CommonTree LB24_tree=null;
        CommonTree RB25_tree=null;
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_LB=new RewriteRuleTokenStream(adaptor,"token LB");
        RewriteRuleTokenStream stream_RB=new RewriteRuleTokenStream(adaptor,"token RB");

        try {
            // VSLParser.g:37:7: ( IDENT | IDENT LB RB -> ^( ARRAY IDENT ) )
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==IDENT) ) {
                int LA6_1 = input.LA(2);

                if ( (LA6_1==LB) ) {
                    alt6=2;
                }
                else if ( (LA6_1==COM||LA6_1==RP) ) {
                    alt6=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 6, 1, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;

            }
            switch (alt6) {
                case 1 :
                    // VSLParser.g:37:9: IDENT
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    IDENT22=(Token)match(input,IDENT,FOLLOW_IDENT_in_param277); 
                    IDENT22_tree = 
                    (CommonTree)adaptor.create(IDENT22)
                    ;
                    adaptor.addChild(root_0, IDENT22_tree);


                    }
                    break;
                case 2 :
                    // VSLParser.g:38:7: IDENT LB RB
                    {
                    IDENT23=(Token)match(input,IDENT,FOLLOW_IDENT_in_param285);  
                    stream_IDENT.add(IDENT23);


                    LB24=(Token)match(input,LB,FOLLOW_LB_in_param287);  
                    stream_LB.add(LB24);


                    RB25=(Token)match(input,RB,FOLLOW_RB_in_param289);  
                    stream_RB.add(RB25);


                    // AST REWRITE
                    // elements: IDENT
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 38:19: -> ^( ARRAY IDENT )
                    {
                        // VSLParser.g:38:22: ^( ARRAY IDENT )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(ARRAY, "ARRAY")
                        , root_1);

                        adaptor.addChild(root_1, 
                        stream_IDENT.nextNode()
                        );

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "param"


    public static class statement_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "statement"
    // VSLParser.g:41:1: statement : ( IDENT ASSIGN_KW expression -> ^( ASSIGN_KW expression IDENT ) | array_elem ASSIGN_KW expression -> ^( ASSIGN_KW expression array_elem ) | RETURN_KW ^ expression | PRINT_KW ^ print_list | READ_KW ^ read_list | IF_KW ^ expression THEN_KW ! statement ( ELSE_KW ! statement )? FI_KW !| WHILE_KW ^ expression DO_KW ! statement OD_KW !| IDENT LP argument_list RP -> ^( FCALL_S IDENT ( argument_list )? ) | block );
    public final VSLParser.statement_return statement() throws RecognitionException {
        VSLParser.statement_return retval = new VSLParser.statement_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENT26=null;
        Token ASSIGN_KW27=null;
        Token ASSIGN_KW30=null;
        Token RETURN_KW32=null;
        Token PRINT_KW34=null;
        Token READ_KW36=null;
        Token IF_KW38=null;
        Token THEN_KW40=null;
        Token ELSE_KW42=null;
        Token FI_KW44=null;
        Token WHILE_KW45=null;
        Token DO_KW47=null;
        Token OD_KW49=null;
        Token IDENT50=null;
        Token LP51=null;
        Token RP53=null;
        VSLParser.expression_return expression28 =null;

        VSLParser.array_elem_return array_elem29 =null;

        VSLParser.expression_return expression31 =null;

        VSLParser.expression_return expression33 =null;

        VSLParser.print_list_return print_list35 =null;

        VSLParser.read_list_return read_list37 =null;

        VSLParser.expression_return expression39 =null;

        VSLParser.statement_return statement41 =null;

        VSLParser.statement_return statement43 =null;

        VSLParser.expression_return expression46 =null;

        VSLParser.statement_return statement48 =null;

        VSLParser.argument_list_return argument_list52 =null;

        VSLParser.block_return block54 =null;


        CommonTree IDENT26_tree=null;
        CommonTree ASSIGN_KW27_tree=null;
        CommonTree ASSIGN_KW30_tree=null;
        CommonTree RETURN_KW32_tree=null;
        CommonTree PRINT_KW34_tree=null;
        CommonTree READ_KW36_tree=null;
        CommonTree IF_KW38_tree=null;
        CommonTree THEN_KW40_tree=null;
        CommonTree ELSE_KW42_tree=null;
        CommonTree FI_KW44_tree=null;
        CommonTree WHILE_KW45_tree=null;
        CommonTree DO_KW47_tree=null;
        CommonTree OD_KW49_tree=null;
        CommonTree IDENT50_tree=null;
        CommonTree LP51_tree=null;
        CommonTree RP53_tree=null;
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_ASSIGN_KW=new RewriteRuleTokenStream(adaptor,"token ASSIGN_KW");
        RewriteRuleTokenStream stream_RP=new RewriteRuleTokenStream(adaptor,"token RP");
        RewriteRuleTokenStream stream_LP=new RewriteRuleTokenStream(adaptor,"token LP");
        RewriteRuleSubtreeStream stream_argument_list=new RewriteRuleSubtreeStream(adaptor,"rule argument_list");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        RewriteRuleSubtreeStream stream_array_elem=new RewriteRuleSubtreeStream(adaptor,"rule array_elem");
        try {
            // VSLParser.g:41:11: ( IDENT ASSIGN_KW expression -> ^( ASSIGN_KW expression IDENT ) | array_elem ASSIGN_KW expression -> ^( ASSIGN_KW expression array_elem ) | RETURN_KW ^ expression | PRINT_KW ^ print_list | READ_KW ^ read_list | IF_KW ^ expression THEN_KW ! statement ( ELSE_KW ! statement )? FI_KW !| WHILE_KW ^ expression DO_KW ! statement OD_KW !| IDENT LP argument_list RP -> ^( FCALL_S IDENT ( argument_list )? ) | block )
            int alt8=9;
            switch ( input.LA(1) ) {
            case IDENT:
                {
                switch ( input.LA(2) ) {
                case ASSIGN_KW:
                    {
                    alt8=1;
                    }
                    break;
                case LB:
                    {
                    alt8=2;
                    }
                    break;
                case LP:
                    {
                    alt8=8;
                    }
                    break;
                default:
                    NoViableAltException nvae =
                        new NoViableAltException("", 8, 1, input);

                    throw nvae;

                }

                }
                break;
            case RETURN_KW:
                {
                alt8=3;
                }
                break;
            case PRINT_KW:
                {
                alt8=4;
                }
                break;
            case READ_KW:
                {
                alt8=5;
                }
                break;
            case IF_KW:
                {
                alt8=6;
                }
                break;
            case WHILE_KW:
                {
                alt8=7;
                }
                break;
            case LC:
                {
                alt8=9;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 8, 0, input);

                throw nvae;

            }

            switch (alt8) {
                case 1 :
                    // VSLParser.g:41:13: IDENT ASSIGN_KW expression
                    {
                    IDENT26=(Token)match(input,IDENT,FOLLOW_IDENT_in_statement310);  
                    stream_IDENT.add(IDENT26);


                    ASSIGN_KW27=(Token)match(input,ASSIGN_KW,FOLLOW_ASSIGN_KW_in_statement312);  
                    stream_ASSIGN_KW.add(ASSIGN_KW27);


                    pushFollow(FOLLOW_expression_in_statement314);
                    expression28=expression();

                    state._fsp--;

                    stream_expression.add(expression28.getTree());

                    // AST REWRITE
                    // elements: IDENT, expression, ASSIGN_KW
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 41:40: -> ^( ASSIGN_KW expression IDENT )
                    {
                        // VSLParser.g:41:43: ^( ASSIGN_KW expression IDENT )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        stream_ASSIGN_KW.nextNode()
                        , root_1);

                        adaptor.addChild(root_1, stream_expression.nextTree());

                        adaptor.addChild(root_1, 
                        stream_IDENT.nextNode()
                        );

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // VSLParser.g:42:7: array_elem ASSIGN_KW expression
                    {
                    pushFollow(FOLLOW_array_elem_in_statement332);
                    array_elem29=array_elem();

                    state._fsp--;

                    stream_array_elem.add(array_elem29.getTree());

                    ASSIGN_KW30=(Token)match(input,ASSIGN_KW,FOLLOW_ASSIGN_KW_in_statement334);  
                    stream_ASSIGN_KW.add(ASSIGN_KW30);


                    pushFollow(FOLLOW_expression_in_statement336);
                    expression31=expression();

                    state._fsp--;

                    stream_expression.add(expression31.getTree());

                    // AST REWRITE
                    // elements: ASSIGN_KW, expression, array_elem
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 42:39: -> ^( ASSIGN_KW expression array_elem )
                    {
                        // VSLParser.g:42:42: ^( ASSIGN_KW expression array_elem )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        stream_ASSIGN_KW.nextNode()
                        , root_1);

                        adaptor.addChild(root_1, stream_expression.nextTree());

                        adaptor.addChild(root_1, stream_array_elem.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 3 :
                    // VSLParser.g:43:7: RETURN_KW ^ expression
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    RETURN_KW32=(Token)match(input,RETURN_KW,FOLLOW_RETURN_KW_in_statement354); 
                    RETURN_KW32_tree = 
                    (CommonTree)adaptor.create(RETURN_KW32)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(RETURN_KW32_tree, root_0);


                    pushFollow(FOLLOW_expression_in_statement357);
                    expression33=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression33.getTree());

                    }
                    break;
                case 4 :
                    // VSLParser.g:44:7: PRINT_KW ^ print_list
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    PRINT_KW34=(Token)match(input,PRINT_KW,FOLLOW_PRINT_KW_in_statement365); 
                    PRINT_KW34_tree = 
                    (CommonTree)adaptor.create(PRINT_KW34)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(PRINT_KW34_tree, root_0);


                    pushFollow(FOLLOW_print_list_in_statement368);
                    print_list35=print_list();

                    state._fsp--;

                    adaptor.addChild(root_0, print_list35.getTree());

                    }
                    break;
                case 5 :
                    // VSLParser.g:45:7: READ_KW ^ read_list
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    READ_KW36=(Token)match(input,READ_KW,FOLLOW_READ_KW_in_statement376); 
                    READ_KW36_tree = 
                    (CommonTree)adaptor.create(READ_KW36)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(READ_KW36_tree, root_0);


                    pushFollow(FOLLOW_read_list_in_statement379);
                    read_list37=read_list();

                    state._fsp--;

                    adaptor.addChild(root_0, read_list37.getTree());

                    }
                    break;
                case 6 :
                    // VSLParser.g:46:7: IF_KW ^ expression THEN_KW ! statement ( ELSE_KW ! statement )? FI_KW !
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    IF_KW38=(Token)match(input,IF_KW,FOLLOW_IF_KW_in_statement387); 
                    IF_KW38_tree = 
                    (CommonTree)adaptor.create(IF_KW38)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(IF_KW38_tree, root_0);


                    pushFollow(FOLLOW_expression_in_statement390);
                    expression39=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression39.getTree());

                    THEN_KW40=(Token)match(input,THEN_KW,FOLLOW_THEN_KW_in_statement392); 

                    pushFollow(FOLLOW_statement_in_statement395);
                    statement41=statement();

                    state._fsp--;

                    adaptor.addChild(root_0, statement41.getTree());

                    // VSLParser.g:46:44: ( ELSE_KW ! statement )?
                    int alt7=2;
                    int LA7_0 = input.LA(1);

                    if ( (LA7_0==ELSE_KW) ) {
                        alt7=1;
                    }
                    switch (alt7) {
                        case 1 :
                            // VSLParser.g:46:45: ELSE_KW ! statement
                            {
                            ELSE_KW42=(Token)match(input,ELSE_KW,FOLLOW_ELSE_KW_in_statement398); 

                            pushFollow(FOLLOW_statement_in_statement401);
                            statement43=statement();

                            state._fsp--;

                            adaptor.addChild(root_0, statement43.getTree());

                            }
                            break;

                    }


                    FI_KW44=(Token)match(input,FI_KW,FOLLOW_FI_KW_in_statement405); 

                    }
                    break;
                case 7 :
                    // VSLParser.g:47:7: WHILE_KW ^ expression DO_KW ! statement OD_KW !
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    WHILE_KW45=(Token)match(input,WHILE_KW,FOLLOW_WHILE_KW_in_statement414); 
                    WHILE_KW45_tree = 
                    (CommonTree)adaptor.create(WHILE_KW45)
                    ;
                    root_0 = (CommonTree)adaptor.becomeRoot(WHILE_KW45_tree, root_0);


                    pushFollow(FOLLOW_expression_in_statement417);
                    expression46=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression46.getTree());

                    DO_KW47=(Token)match(input,DO_KW,FOLLOW_DO_KW_in_statement419); 

                    pushFollow(FOLLOW_statement_in_statement422);
                    statement48=statement();

                    state._fsp--;

                    adaptor.addChild(root_0, statement48.getTree());

                    OD_KW49=(Token)match(input,OD_KW,FOLLOW_OD_KW_in_statement424); 

                    }
                    break;
                case 8 :
                    // VSLParser.g:48:7: IDENT LP argument_list RP
                    {
                    IDENT50=(Token)match(input,IDENT,FOLLOW_IDENT_in_statement433);  
                    stream_IDENT.add(IDENT50);


                    LP51=(Token)match(input,LP,FOLLOW_LP_in_statement435);  
                    stream_LP.add(LP51);


                    pushFollow(FOLLOW_argument_list_in_statement437);
                    argument_list52=argument_list();

                    state._fsp--;

                    stream_argument_list.add(argument_list52.getTree());

                    RP53=(Token)match(input,RP,FOLLOW_RP_in_statement439);  
                    stream_RP.add(RP53);


                    // AST REWRITE
                    // elements: IDENT, argument_list
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 48:33: -> ^( FCALL_S IDENT ( argument_list )? )
                    {
                        // VSLParser.g:48:36: ^( FCALL_S IDENT ( argument_list )? )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(FCALL_S, "FCALL_S")
                        , root_1);

                        adaptor.addChild(root_1, 
                        stream_IDENT.nextNode()
                        );

                        // VSLParser.g:48:52: ( argument_list )?
                        if ( stream_argument_list.hasNext() ) {
                            adaptor.addChild(root_1, stream_argument_list.nextTree());

                        }
                        stream_argument_list.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 9 :
                    // VSLParser.g:49:7: block
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_block_in_statement458);
                    block54=block();

                    state._fsp--;

                    adaptor.addChild(root_0, block54.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "statement"


    public static class block_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "block"
    // VSLParser.g:52:1: block : ( LC declaration inst_list RC -> ^( BLOCK declaration inst_list ) | LC inst_list RC -> ^( BLOCK inst_list ) );
    public final VSLParser.block_return block() throws RecognitionException {
        VSLParser.block_return retval = new VSLParser.block_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token LC55=null;
        Token RC58=null;
        Token LC59=null;
        Token RC61=null;
        VSLParser.declaration_return declaration56 =null;

        VSLParser.inst_list_return inst_list57 =null;

        VSLParser.inst_list_return inst_list60 =null;


        CommonTree LC55_tree=null;
        CommonTree RC58_tree=null;
        CommonTree LC59_tree=null;
        CommonTree RC61_tree=null;
        RewriteRuleTokenStream stream_LC=new RewriteRuleTokenStream(adaptor,"token LC");
        RewriteRuleTokenStream stream_RC=new RewriteRuleTokenStream(adaptor,"token RC");
        RewriteRuleSubtreeStream stream_declaration=new RewriteRuleSubtreeStream(adaptor,"rule declaration");
        RewriteRuleSubtreeStream stream_inst_list=new RewriteRuleSubtreeStream(adaptor,"rule inst_list");
        try {
            // VSLParser.g:52:7: ( LC declaration inst_list RC -> ^( BLOCK declaration inst_list ) | LC inst_list RC -> ^( BLOCK inst_list ) )
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( (LA9_0==LC) ) {
                int LA9_1 = input.LA(2);

                if ( (LA9_1==INT_KW) ) {
                    alt9=1;
                }
                else if ( ((LA9_1 >= IDENT && LA9_1 <= IF_KW)||LA9_1==LC||LA9_1==PRINT_KW||(LA9_1 >= READ_KW && LA9_1 <= RETURN_KW)||LA9_1==WHILE_KW) ) {
                    alt9=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 9, 1, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 9, 0, input);

                throw nvae;

            }
            switch (alt9) {
                case 1 :
                    // VSLParser.g:52:9: LC declaration inst_list RC
                    {
                    LC55=(Token)match(input,LC,FOLLOW_LC_in_block472);  
                    stream_LC.add(LC55);


                    pushFollow(FOLLOW_declaration_in_block474);
                    declaration56=declaration();

                    state._fsp--;

                    stream_declaration.add(declaration56.getTree());

                    pushFollow(FOLLOW_inst_list_in_block476);
                    inst_list57=inst_list();

                    state._fsp--;

                    stream_inst_list.add(inst_list57.getTree());

                    RC58=(Token)match(input,RC,FOLLOW_RC_in_block478);  
                    stream_RC.add(RC58);


                    // AST REWRITE
                    // elements: declaration, inst_list
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 52:37: -> ^( BLOCK declaration inst_list )
                    {
                        // VSLParser.g:52:40: ^( BLOCK declaration inst_list )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(BLOCK, "BLOCK")
                        , root_1);

                        adaptor.addChild(root_1, stream_declaration.nextTree());

                        adaptor.addChild(root_1, stream_inst_list.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // VSLParser.g:53:7: LC inst_list RC
                    {
                    LC59=(Token)match(input,LC,FOLLOW_LC_in_block496);  
                    stream_LC.add(LC59);


                    pushFollow(FOLLOW_inst_list_in_block498);
                    inst_list60=inst_list();

                    state._fsp--;

                    stream_inst_list.add(inst_list60.getTree());

                    RC61=(Token)match(input,RC,FOLLOW_RC_in_block500);  
                    stream_RC.add(RC61);


                    // AST REWRITE
                    // elements: inst_list
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 53:23: -> ^( BLOCK inst_list )
                    {
                        // VSLParser.g:53:26: ^( BLOCK inst_list )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(BLOCK, "BLOCK")
                        , root_1);

                        adaptor.addChild(root_1, stream_inst_list.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "block"


    public static class array_elem_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "array_elem"
    // VSLParser.g:56:1: array_elem : IDENT LB expression RB -> ^( ARELEM IDENT expression ) ;
    public final VSLParser.array_elem_return array_elem() throws RecognitionException {
        VSLParser.array_elem_return retval = new VSLParser.array_elem_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENT62=null;
        Token LB63=null;
        Token RB65=null;
        VSLParser.expression_return expression64 =null;


        CommonTree IDENT62_tree=null;
        CommonTree LB63_tree=null;
        CommonTree RB65_tree=null;
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_LB=new RewriteRuleTokenStream(adaptor,"token LB");
        RewriteRuleTokenStream stream_RB=new RewriteRuleTokenStream(adaptor,"token RB");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        try {
            // VSLParser.g:56:12: ( IDENT LB expression RB -> ^( ARELEM IDENT expression ) )
            // VSLParser.g:56:14: IDENT LB expression RB
            {
            IDENT62=(Token)match(input,IDENT,FOLLOW_IDENT_in_array_elem525);  
            stream_IDENT.add(IDENT62);


            LB63=(Token)match(input,LB,FOLLOW_LB_in_array_elem527);  
            stream_LB.add(LB63);


            pushFollow(FOLLOW_expression_in_array_elem529);
            expression64=expression();

            state._fsp--;

            stream_expression.add(expression64.getTree());

            RB65=(Token)match(input,RB,FOLLOW_RB_in_array_elem531);  
            stream_RB.add(RB65);


            // AST REWRITE
            // elements: IDENT, expression
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 56:37: -> ^( ARELEM IDENT expression )
            {
                // VSLParser.g:56:41: ^( ARELEM IDENT expression )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(ARELEM, "ARELEM")
                , root_1);

                adaptor.addChild(root_1, 
                stream_IDENT.nextNode()
                );

                adaptor.addChild(root_1, stream_expression.nextTree());

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "array_elem"


    public static class inst_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "inst_list"
    // VSLParser.g:59:1: inst_list : ( statement )+ -> ^( INST ( statement )* ) ;
    public final VSLParser.inst_list_return inst_list() throws RecognitionException {
        VSLParser.inst_list_return retval = new VSLParser.inst_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        VSLParser.statement_return statement66 =null;


        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        try {
            // VSLParser.g:59:11: ( ( statement )+ -> ^( INST ( statement )* ) )
            // VSLParser.g:59:13: ( statement )+
            {
            // VSLParser.g:59:13: ( statement )+
            int cnt10=0;
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( ((LA10_0 >= IDENT && LA10_0 <= IF_KW)||LA10_0==LC||LA10_0==PRINT_KW||(LA10_0 >= READ_KW && LA10_0 <= RETURN_KW)||LA10_0==WHILE_KW) ) {
                    alt10=1;
                }


                switch (alt10) {
            	case 1 :
            	    // VSLParser.g:59:13: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_inst_list556);
            	    statement66=statement();

            	    state._fsp--;

            	    stream_statement.add(statement66.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt10 >= 1 ) break loop10;
                        EarlyExitException eee =
                            new EarlyExitException(10, input);
                        throw eee;
                }
                cnt10++;
            } while (true);


            // AST REWRITE
            // elements: statement
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 59:24: -> ^( INST ( statement )* )
            {
                // VSLParser.g:59:27: ^( INST ( statement )* )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(INST, "INST")
                , root_1);

                // VSLParser.g:59:34: ( statement )*
                while ( stream_statement.hasNext() ) {
                    adaptor.addChild(root_1, stream_statement.nextTree());

                }
                stream_statement.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "inst_list"


    public static class expression_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "expression"
    // VSLParser.g:62:1: expression : factor ( ( PLUS ^| MINUS ^) factor )* ;
    public final VSLParser.expression_return expression() throws RecognitionException {
        VSLParser.expression_return retval = new VSLParser.expression_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token PLUS68=null;
        Token MINUS69=null;
        VSLParser.factor_return factor67 =null;

        VSLParser.factor_return factor70 =null;


        CommonTree PLUS68_tree=null;
        CommonTree MINUS69_tree=null;

        try {
            // VSLParser.g:62:12: ( factor ( ( PLUS ^| MINUS ^) factor )* )
            // VSLParser.g:62:14: factor ( ( PLUS ^| MINUS ^) factor )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_factor_in_expression579);
            factor67=factor();

            state._fsp--;

            adaptor.addChild(root_0, factor67.getTree());

            // VSLParser.g:62:21: ( ( PLUS ^| MINUS ^) factor )*
            loop12:
            do {
                int alt12=2;
                int LA12_0 = input.LA(1);

                if ( (LA12_0==MINUS||LA12_0==PLUS) ) {
                    alt12=1;
                }


                switch (alt12) {
            	case 1 :
            	    // VSLParser.g:62:22: ( PLUS ^| MINUS ^) factor
            	    {
            	    // VSLParser.g:62:22: ( PLUS ^| MINUS ^)
            	    int alt11=2;
            	    int LA11_0 = input.LA(1);

            	    if ( (LA11_0==PLUS) ) {
            	        alt11=1;
            	    }
            	    else if ( (LA11_0==MINUS) ) {
            	        alt11=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 11, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt11) {
            	        case 1 :
            	            // VSLParser.g:62:23: PLUS ^
            	            {
            	            PLUS68=(Token)match(input,PLUS,FOLLOW_PLUS_in_expression583); 
            	            PLUS68_tree = 
            	            (CommonTree)adaptor.create(PLUS68)
            	            ;
            	            root_0 = (CommonTree)adaptor.becomeRoot(PLUS68_tree, root_0);


            	            }
            	            break;
            	        case 2 :
            	            // VSLParser.g:62:29: MINUS ^
            	            {
            	            MINUS69=(Token)match(input,MINUS,FOLLOW_MINUS_in_expression586); 
            	            MINUS69_tree = 
            	            (CommonTree)adaptor.create(MINUS69)
            	            ;
            	            root_0 = (CommonTree)adaptor.becomeRoot(MINUS69_tree, root_0);


            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_factor_in_expression590);
            	    factor70=factor();

            	    state._fsp--;

            	    adaptor.addChild(root_0, factor70.getTree());

            	    }
            	    break;

            	default :
            	    break loop12;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "expression"


    public static class factor_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "factor"
    // VSLParser.g:65:1: factor : primary ( ( MUL ^| DIV ^) primary )* ;
    public final VSLParser.factor_return factor() throws RecognitionException {
        VSLParser.factor_return retval = new VSLParser.factor_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token MUL72=null;
        Token DIV73=null;
        VSLParser.primary_return primary71 =null;

        VSLParser.primary_return primary74 =null;


        CommonTree MUL72_tree=null;
        CommonTree DIV73_tree=null;

        try {
            // VSLParser.g:65:8: ( primary ( ( MUL ^| DIV ^) primary )* )
            // VSLParser.g:65:10: primary ( ( MUL ^| DIV ^) primary )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_primary_in_factor605);
            primary71=primary();

            state._fsp--;

            adaptor.addChild(root_0, primary71.getTree());

            // VSLParser.g:65:18: ( ( MUL ^| DIV ^) primary )*
            loop14:
            do {
                int alt14=2;
                int LA14_0 = input.LA(1);

                if ( (LA14_0==DIV||LA14_0==MUL) ) {
                    alt14=1;
                }


                switch (alt14) {
            	case 1 :
            	    // VSLParser.g:65:19: ( MUL ^| DIV ^) primary
            	    {
            	    // VSLParser.g:65:19: ( MUL ^| DIV ^)
            	    int alt13=2;
            	    int LA13_0 = input.LA(1);

            	    if ( (LA13_0==MUL) ) {
            	        alt13=1;
            	    }
            	    else if ( (LA13_0==DIV) ) {
            	        alt13=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 13, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt13) {
            	        case 1 :
            	            // VSLParser.g:65:20: MUL ^
            	            {
            	            MUL72=(Token)match(input,MUL,FOLLOW_MUL_in_factor609); 
            	            MUL72_tree = 
            	            (CommonTree)adaptor.create(MUL72)
            	            ;
            	            root_0 = (CommonTree)adaptor.becomeRoot(MUL72_tree, root_0);


            	            }
            	            break;
            	        case 2 :
            	            // VSLParser.g:65:25: DIV ^
            	            {
            	            DIV73=(Token)match(input,DIV,FOLLOW_DIV_in_factor612); 
            	            DIV73_tree = 
            	            (CommonTree)adaptor.create(DIV73)
            	            ;
            	            root_0 = (CommonTree)adaptor.becomeRoot(DIV73_tree, root_0);


            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_primary_in_factor616);
            	    primary74=primary();

            	    state._fsp--;

            	    adaptor.addChild(root_0, primary74.getTree());

            	    }
            	    break;

            	default :
            	    break loop14;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "factor"


    public static class primary_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "primary"
    // VSLParser.g:68:1: primary : ( INTEGER | IDENT | array_elem | IDENT LP argument_list RP -> ^( FCALL IDENT ( argument_list )? ) | LP ! expression RP !);
    public final VSLParser.primary_return primary() throws RecognitionException {
        VSLParser.primary_return retval = new VSLParser.primary_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token INTEGER75=null;
        Token IDENT76=null;
        Token IDENT78=null;
        Token LP79=null;
        Token RP81=null;
        Token LP82=null;
        Token RP84=null;
        VSLParser.array_elem_return array_elem77 =null;

        VSLParser.argument_list_return argument_list80 =null;

        VSLParser.expression_return expression83 =null;


        CommonTree INTEGER75_tree=null;
        CommonTree IDENT76_tree=null;
        CommonTree IDENT78_tree=null;
        CommonTree LP79_tree=null;
        CommonTree RP81_tree=null;
        CommonTree LP82_tree=null;
        CommonTree RP84_tree=null;
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_RP=new RewriteRuleTokenStream(adaptor,"token RP");
        RewriteRuleTokenStream stream_LP=new RewriteRuleTokenStream(adaptor,"token LP");
        RewriteRuleSubtreeStream stream_argument_list=new RewriteRuleSubtreeStream(adaptor,"rule argument_list");
        try {
            // VSLParser.g:68:9: ( INTEGER | IDENT | array_elem | IDENT LP argument_list RP -> ^( FCALL IDENT ( argument_list )? ) | LP ! expression RP !)
            int alt15=5;
            switch ( input.LA(1) ) {
            case INTEGER:
                {
                alt15=1;
                }
                break;
            case IDENT:
                {
                switch ( input.LA(2) ) {
                case LB:
                    {
                    alt15=3;
                    }
                    break;
                case LP:
                    {
                    alt15=4;
                    }
                    break;
                case EOF:
                case COM:
                case DIV:
                case DO_KW:
                case ELSE_KW:
                case FI_KW:
                case FUNC_KW:
                case IDENT:
                case IF_KW:
                case LC:
                case MINUS:
                case MUL:
                case OD_KW:
                case PLUS:
                case PRINT_KW:
                case PROTO_KW:
                case RB:
                case RC:
                case READ_KW:
                case RETURN_KW:
                case RP:
                case THEN_KW:
                case WHILE_KW:
                    {
                    alt15=2;
                    }
                    break;
                default:
                    NoViableAltException nvae =
                        new NoViableAltException("", 15, 2, input);

                    throw nvae;

                }

                }
                break;
            case LP:
                {
                alt15=5;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 15, 0, input);

                throw nvae;

            }

            switch (alt15) {
                case 1 :
                    // VSLParser.g:68:11: INTEGER
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    INTEGER75=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_primary631); 
                    INTEGER75_tree = 
                    (CommonTree)adaptor.create(INTEGER75)
                    ;
                    adaptor.addChild(root_0, INTEGER75_tree);


                    }
                    break;
                case 2 :
                    // VSLParser.g:69:7: IDENT
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    IDENT76=(Token)match(input,IDENT,FOLLOW_IDENT_in_primary639); 
                    IDENT76_tree = 
                    (CommonTree)adaptor.create(IDENT76)
                    ;
                    adaptor.addChild(root_0, IDENT76_tree);


                    }
                    break;
                case 3 :
                    // VSLParser.g:70:7: array_elem
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_array_elem_in_primary647);
                    array_elem77=array_elem();

                    state._fsp--;

                    adaptor.addChild(root_0, array_elem77.getTree());

                    }
                    break;
                case 4 :
                    // VSLParser.g:71:7: IDENT LP argument_list RP
                    {
                    IDENT78=(Token)match(input,IDENT,FOLLOW_IDENT_in_primary655);  
                    stream_IDENT.add(IDENT78);


                    LP79=(Token)match(input,LP,FOLLOW_LP_in_primary657);  
                    stream_LP.add(LP79);


                    pushFollow(FOLLOW_argument_list_in_primary659);
                    argument_list80=argument_list();

                    state._fsp--;

                    stream_argument_list.add(argument_list80.getTree());

                    RP81=(Token)match(input,RP,FOLLOW_RP_in_primary661);  
                    stream_RP.add(RP81);


                    // AST REWRITE
                    // elements: IDENT, argument_list
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 71:33: -> ^( FCALL IDENT ( argument_list )? )
                    {
                        // VSLParser.g:71:36: ^( FCALL IDENT ( argument_list )? )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(FCALL, "FCALL")
                        , root_1);

                        adaptor.addChild(root_1, 
                        stream_IDENT.nextNode()
                        );

                        // VSLParser.g:71:50: ( argument_list )?
                        if ( stream_argument_list.hasNext() ) {
                            adaptor.addChild(root_1, stream_argument_list.nextTree());

                        }
                        stream_argument_list.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 5 :
                    // VSLParser.g:72:7: LP ! expression RP !
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    LP82=(Token)match(input,LP,FOLLOW_LP_in_primary680); 

                    pushFollow(FOLLOW_expression_in_primary683);
                    expression83=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression83.getTree());

                    RP84=(Token)match(input,RP,FOLLOW_RP_in_primary685); 

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "primary"


    public static class argument_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "argument_list"
    // VSLParser.g:75:1: argument_list : ( expression ( COM ! expression )* |);
    public final VSLParser.argument_list_return argument_list() throws RecognitionException {
        VSLParser.argument_list_return retval = new VSLParser.argument_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COM86=null;
        VSLParser.expression_return expression85 =null;

        VSLParser.expression_return expression87 =null;


        CommonTree COM86_tree=null;

        try {
            // VSLParser.g:75:15: ( expression ( COM ! expression )* |)
            int alt17=2;
            int LA17_0 = input.LA(1);

            if ( (LA17_0==IDENT||LA17_0==INTEGER||LA17_0==LP) ) {
                alt17=1;
            }
            else if ( (LA17_0==RP) ) {
                alt17=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                throw nvae;

            }
            switch (alt17) {
                case 1 :
                    // VSLParser.g:75:17: expression ( COM ! expression )*
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_expression_in_argument_list699);
                    expression85=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression85.getTree());

                    // VSLParser.g:75:28: ( COM ! expression )*
                    loop16:
                    do {
                        int alt16=2;
                        int LA16_0 = input.LA(1);

                        if ( (LA16_0==COM) ) {
                            alt16=1;
                        }


                        switch (alt16) {
                    	case 1 :
                    	    // VSLParser.g:75:29: COM ! expression
                    	    {
                    	    COM86=(Token)match(input,COM,FOLLOW_COM_in_argument_list702); 

                    	    pushFollow(FOLLOW_expression_in_argument_list705);
                    	    expression87=expression();

                    	    state._fsp--;

                    	    adaptor.addChild(root_0, expression87.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop16;
                        }
                    } while (true);


                    }
                    break;
                case 2 :
                    // VSLParser.g:77:5: 
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "argument_list"


    public static class print_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "print_list"
    // VSLParser.g:79:1: print_list : print_item ( COM ! print_item )* ;
    public final VSLParser.print_list_return print_list() throws RecognitionException {
        VSLParser.print_list_return retval = new VSLParser.print_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COM89=null;
        VSLParser.print_item_return print_item88 =null;

        VSLParser.print_item_return print_item90 =null;


        CommonTree COM89_tree=null;

        try {
            // VSLParser.g:79:12: ( print_item ( COM ! print_item )* )
            // VSLParser.g:79:14: print_item ( COM ! print_item )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_print_item_in_print_list726);
            print_item88=print_item();

            state._fsp--;

            adaptor.addChild(root_0, print_item88.getTree());

            // VSLParser.g:79:25: ( COM ! print_item )*
            loop18:
            do {
                int alt18=2;
                int LA18_0 = input.LA(1);

                if ( (LA18_0==COM) ) {
                    alt18=1;
                }


                switch (alt18) {
            	case 1 :
            	    // VSLParser.g:79:26: COM ! print_item
            	    {
            	    COM89=(Token)match(input,COM,FOLLOW_COM_in_print_list729); 

            	    pushFollow(FOLLOW_print_item_in_print_list732);
            	    print_item90=print_item();

            	    state._fsp--;

            	    adaptor.addChild(root_0, print_item90.getTree());

            	    }
            	    break;

            	default :
            	    break loop18;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "print_list"


    public static class print_item_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "print_item"
    // VSLParser.g:82:1: print_item : ( TEXT | expression );
    public final VSLParser.print_item_return print_item() throws RecognitionException {
        VSLParser.print_item_return retval = new VSLParser.print_item_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token TEXT91=null;
        VSLParser.expression_return expression92 =null;


        CommonTree TEXT91_tree=null;

        try {
            // VSLParser.g:82:12: ( TEXT | expression )
            int alt19=2;
            int LA19_0 = input.LA(1);

            if ( (LA19_0==TEXT) ) {
                alt19=1;
            }
            else if ( (LA19_0==IDENT||LA19_0==INTEGER||LA19_0==LP) ) {
                alt19=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 19, 0, input);

                throw nvae;

            }
            switch (alt19) {
                case 1 :
                    // VSLParser.g:82:14: TEXT
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    TEXT91=(Token)match(input,TEXT,FOLLOW_TEXT_in_print_item747); 
                    TEXT91_tree = 
                    (CommonTree)adaptor.create(TEXT91)
                    ;
                    adaptor.addChild(root_0, TEXT91_tree);


                    }
                    break;
                case 2 :
                    // VSLParser.g:83:7: expression
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_expression_in_print_item755);
                    expression92=expression();

                    state._fsp--;

                    adaptor.addChild(root_0, expression92.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "print_item"


    public static class read_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "read_list"
    // VSLParser.g:86:1: read_list : read_item ( COM ! read_item )* ;
    public final VSLParser.read_list_return read_list() throws RecognitionException {
        VSLParser.read_list_return retval = new VSLParser.read_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COM94=null;
        VSLParser.read_item_return read_item93 =null;

        VSLParser.read_item_return read_item95 =null;


        CommonTree COM94_tree=null;

        try {
            // VSLParser.g:86:11: ( read_item ( COM ! read_item )* )
            // VSLParser.g:86:13: read_item ( COM ! read_item )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_read_item_in_read_list768);
            read_item93=read_item();

            state._fsp--;

            adaptor.addChild(root_0, read_item93.getTree());

            // VSLParser.g:86:23: ( COM ! read_item )*
            loop20:
            do {
                int alt20=2;
                int LA20_0 = input.LA(1);

                if ( (LA20_0==COM) ) {
                    alt20=1;
                }


                switch (alt20) {
            	case 1 :
            	    // VSLParser.g:86:24: COM ! read_item
            	    {
            	    COM94=(Token)match(input,COM,FOLLOW_COM_in_read_list771); 

            	    pushFollow(FOLLOW_read_item_in_read_list774);
            	    read_item95=read_item();

            	    state._fsp--;

            	    adaptor.addChild(root_0, read_item95.getTree());

            	    }
            	    break;

            	default :
            	    break loop20;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "read_list"


    public static class read_item_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "read_item"
    // VSLParser.g:89:1: read_item : ( IDENT | array_elem );
    public final VSLParser.read_item_return read_item() throws RecognitionException {
        VSLParser.read_item_return retval = new VSLParser.read_item_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENT96=null;
        VSLParser.array_elem_return array_elem97 =null;


        CommonTree IDENT96_tree=null;

        try {
            // VSLParser.g:89:11: ( IDENT | array_elem )
            int alt21=2;
            int LA21_0 = input.LA(1);

            if ( (LA21_0==IDENT) ) {
                int LA21_1 = input.LA(2);

                if ( (LA21_1==LB) ) {
                    alt21=2;
                }
                else if ( (LA21_1==EOF||LA21_1==COM||(LA21_1 >= ELSE_KW && LA21_1 <= IF_KW)||LA21_1==LC||LA21_1==OD_KW||(LA21_1 >= PRINT_KW && LA21_1 <= PROTO_KW)||(LA21_1 >= RC && LA21_1 <= RETURN_KW)||LA21_1==WHILE_KW) ) {
                    alt21=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 21, 1, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 21, 0, input);

                throw nvae;

            }
            switch (alt21) {
                case 1 :
                    // VSLParser.g:89:13: IDENT
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    IDENT96=(Token)match(input,IDENT,FOLLOW_IDENT_in_read_item789); 
                    IDENT96_tree = 
                    (CommonTree)adaptor.create(IDENT96)
                    ;
                    adaptor.addChild(root_0, IDENT96_tree);


                    }
                    break;
                case 2 :
                    // VSLParser.g:90:7: array_elem
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_array_elem_in_read_item797);
                    array_elem97=array_elem();

                    state._fsp--;

                    adaptor.addChild(root_0, array_elem97.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "read_item"


    public static class declaration_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "declaration"
    // VSLParser.g:93:1: declaration : ( INT_KW decl_list )+ -> ^( DECL ( decl_list )+ ) ;
    public final VSLParser.declaration_return declaration() throws RecognitionException {
        VSLParser.declaration_return retval = new VSLParser.declaration_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token INT_KW98=null;
        VSLParser.decl_list_return decl_list99 =null;


        CommonTree INT_KW98_tree=null;
        RewriteRuleTokenStream stream_INT_KW=new RewriteRuleTokenStream(adaptor,"token INT_KW");
        RewriteRuleSubtreeStream stream_decl_list=new RewriteRuleSubtreeStream(adaptor,"rule decl_list");
        try {
            // VSLParser.g:93:13: ( ( INT_KW decl_list )+ -> ^( DECL ( decl_list )+ ) )
            // VSLParser.g:93:15: ( INT_KW decl_list )+
            {
            // VSLParser.g:93:15: ( INT_KW decl_list )+
            int cnt22=0;
            loop22:
            do {
                int alt22=2;
                int LA22_0 = input.LA(1);

                if ( (LA22_0==INT_KW) ) {
                    alt22=1;
                }


                switch (alt22) {
            	case 1 :
            	    // VSLParser.g:93:16: INT_KW decl_list
            	    {
            	    INT_KW98=(Token)match(input,INT_KW,FOLLOW_INT_KW_in_declaration811);  
            	    stream_INT_KW.add(INT_KW98);


            	    pushFollow(FOLLOW_decl_list_in_declaration813);
            	    decl_list99=decl_list();

            	    state._fsp--;

            	    stream_decl_list.add(decl_list99.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt22 >= 1 ) break loop22;
                        EarlyExitException eee =
                            new EarlyExitException(22, input);
                        throw eee;
                }
                cnt22++;
            } while (true);


            // AST REWRITE
            // elements: decl_list
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 93:36: -> ^( DECL ( decl_list )+ )
            {
                // VSLParser.g:93:40: ^( DECL ( decl_list )+ )
                {
                CommonTree root_1 = (CommonTree)adaptor.nil();
                root_1 = (CommonTree)adaptor.becomeRoot(
                (CommonTree)adaptor.create(DECL, "DECL")
                , root_1);

                if ( !(stream_decl_list.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_decl_list.hasNext() ) {
                    adaptor.addChild(root_1, stream_decl_list.nextTree());

                }
                stream_decl_list.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "declaration"


    public static class decl_list_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "decl_list"
    // VSLParser.g:96:1: decl_list : decl_item ( COM ! decl_item )* ;
    public final VSLParser.decl_list_return decl_list() throws RecognitionException {
        VSLParser.decl_list_return retval = new VSLParser.decl_list_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token COM101=null;
        VSLParser.decl_item_return decl_item100 =null;

        VSLParser.decl_item_return decl_item102 =null;


        CommonTree COM101_tree=null;

        try {
            // VSLParser.g:96:11: ( decl_item ( COM ! decl_item )* )
            // VSLParser.g:96:13: decl_item ( COM ! decl_item )*
            {
            root_0 = (CommonTree)adaptor.nil();


            pushFollow(FOLLOW_decl_item_in_decl_list840);
            decl_item100=decl_item();

            state._fsp--;

            adaptor.addChild(root_0, decl_item100.getTree());

            // VSLParser.g:96:23: ( COM ! decl_item )*
            loop23:
            do {
                int alt23=2;
                int LA23_0 = input.LA(1);

                if ( (LA23_0==COM) ) {
                    alt23=1;
                }


                switch (alt23) {
            	case 1 :
            	    // VSLParser.g:96:24: COM ! decl_item
            	    {
            	    COM101=(Token)match(input,COM,FOLLOW_COM_in_decl_list843); 

            	    pushFollow(FOLLOW_decl_item_in_decl_list846);
            	    decl_item102=decl_item();

            	    state._fsp--;

            	    adaptor.addChild(root_0, decl_item102.getTree());

            	    }
            	    break;

            	default :
            	    break loop23;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "decl_list"


    public static class decl_item_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "decl_item"
    // VSLParser.g:99:1: decl_item : ( IDENT | IDENT LB INTEGER RB -> ^( ARDECL IDENT INTEGER ) );
    public final VSLParser.decl_item_return decl_item() throws RecognitionException {
        VSLParser.decl_item_return retval = new VSLParser.decl_item_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IDENT103=null;
        Token IDENT104=null;
        Token LB105=null;
        Token INTEGER106=null;
        Token RB107=null;

        CommonTree IDENT103_tree=null;
        CommonTree IDENT104_tree=null;
        CommonTree LB105_tree=null;
        CommonTree INTEGER106_tree=null;
        CommonTree RB107_tree=null;
        RewriteRuleTokenStream stream_INTEGER=new RewriteRuleTokenStream(adaptor,"token INTEGER");
        RewriteRuleTokenStream stream_IDENT=new RewriteRuleTokenStream(adaptor,"token IDENT");
        RewriteRuleTokenStream stream_LB=new RewriteRuleTokenStream(adaptor,"token LB");
        RewriteRuleTokenStream stream_RB=new RewriteRuleTokenStream(adaptor,"token RB");

        try {
            // VSLParser.g:99:11: ( IDENT | IDENT LB INTEGER RB -> ^( ARDECL IDENT INTEGER ) )
            int alt24=2;
            int LA24_0 = input.LA(1);

            if ( (LA24_0==IDENT) ) {
                int LA24_1 = input.LA(2);

                if ( (LA24_1==LB) ) {
                    alt24=2;
                }
                else if ( (LA24_1==COM||(LA24_1 >= IDENT && LA24_1 <= IF_KW)||LA24_1==INT_KW||LA24_1==LC||LA24_1==PRINT_KW||(LA24_1 >= READ_KW && LA24_1 <= RETURN_KW)||LA24_1==WHILE_KW) ) {
                    alt24=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 24, 1, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 24, 0, input);

                throw nvae;

            }
            switch (alt24) {
                case 1 :
                    // VSLParser.g:99:13: IDENT
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    IDENT103=(Token)match(input,IDENT,FOLLOW_IDENT_in_decl_item861); 
                    IDENT103_tree = 
                    (CommonTree)adaptor.create(IDENT103)
                    ;
                    adaptor.addChild(root_0, IDENT103_tree);


                    }
                    break;
                case 2 :
                    // VSLParser.g:100:7: IDENT LB INTEGER RB
                    {
                    IDENT104=(Token)match(input,IDENT,FOLLOW_IDENT_in_decl_item869);  
                    stream_IDENT.add(IDENT104);


                    LB105=(Token)match(input,LB,FOLLOW_LB_in_decl_item871);  
                    stream_LB.add(LB105);


                    INTEGER106=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_decl_item873);  
                    stream_INTEGER.add(INTEGER106);


                    RB107=(Token)match(input,RB,FOLLOW_RB_in_decl_item875);  
                    stream_RB.add(RB107);


                    // AST REWRITE
                    // elements: IDENT, INTEGER
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 100:27: -> ^( ARDECL IDENT INTEGER )
                    {
                        // VSLParser.g:100:30: ^( ARDECL IDENT INTEGER )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        (CommonTree)adaptor.create(ARDECL, "ARDECL")
                        , root_1);

                        adaptor.addChild(root_1, 
                        stream_IDENT.nextNode()
                        );

                        adaptor.addChild(root_1, 
                        stream_INTEGER.nextNode()
                        );

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "decl_item"

    // Delegated rules


 

    public static final BitSet FOLLOW_unit_in_program98 = new BitSet(new long[]{0x0000000008002002L});
    public static final BitSet FOLLOW_function_in_unit121 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_proto_in_unit129 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FUNC_KW_in_function142 = new BitSet(new long[]{0x0000000800020000L});
    public static final BitSet FOLLOW_type_in_function144 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_IDENT_in_function146 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_LP_in_function148 = new BitSet(new long[]{0x0000000100004000L});
    public static final BitSet FOLLOW_param_list_in_function150 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_RP_in_function152 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_statement_in_function154 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PROTO_KW_in_proto186 = new BitSet(new long[]{0x0000000800020000L});
    public static final BitSet FOLLOW_type_in_proto189 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_IDENT_in_proto191 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_LP_in_proto193 = new BitSet(new long[]{0x0000000100004000L});
    public static final BitSet FOLLOW_param_list_in_proto196 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_RP_in_proto198 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_KW_in_type212 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_VOID_KW_in_type222 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_param_in_param_list236 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_COM_in_param_list239 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_param_in_param_list241 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_IDENT_in_param277 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_param285 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_LB_in_param287 = new BitSet(new long[]{0x0000000010000000L});
    public static final BitSet FOLLOW_RB_in_param289 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_statement310 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_ASSIGN_KW_in_statement312 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_statement314 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_array_elem_in_statement332 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_ASSIGN_KW_in_statement334 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_statement336 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RETURN_KW_in_statement354 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_statement357 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PRINT_KW_in_statement365 = new BitSet(new long[]{0x0000000200214000L});
    public static final BitSet FOLLOW_print_list_in_statement368 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_READ_KW_in_statement376 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_read_list_in_statement379 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IF_KW_in_statement387 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_statement390 = new BitSet(new long[]{0x0000000400000000L});
    public static final BitSet FOLLOW_THEN_KW_in_statement392 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_statement_in_statement395 = new BitSet(new long[]{0x0000000000001800L});
    public static final BitSet FOLLOW_ELSE_KW_in_statement398 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_statement_in_statement401 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_FI_KW_in_statement405 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WHILE_KW_in_statement414 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_statement417 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_DO_KW_in_statement419 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_statement_in_statement422 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_OD_KW_in_statement424 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_statement433 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_LP_in_statement435 = new BitSet(new long[]{0x0000000100214000L});
    public static final BitSet FOLLOW_argument_list_in_statement437 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_RP_in_statement439 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_block_in_statement458 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LC_in_block472 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_declaration_in_block474 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_inst_list_in_block476 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_RC_in_block478 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LC_in_block496 = new BitSet(new long[]{0x00000010C408C000L});
    public static final BitSet FOLLOW_inst_list_in_block498 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_RC_in_block500 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_array_elem525 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_LB_in_array_elem527 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_array_elem529 = new BitSet(new long[]{0x0000000010000000L});
    public static final BitSet FOLLOW_RB_in_array_elem531 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_statement_in_inst_list556 = new BitSet(new long[]{0x00000010C408C002L});
    public static final BitSet FOLLOW_factor_in_expression579 = new BitSet(new long[]{0x0000000002400002L});
    public static final BitSet FOLLOW_PLUS_in_expression583 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_MINUS_in_expression586 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_factor_in_expression590 = new BitSet(new long[]{0x0000000002400002L});
    public static final BitSet FOLLOW_primary_in_factor605 = new BitSet(new long[]{0x0000000000800202L});
    public static final BitSet FOLLOW_MUL_in_factor609 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_DIV_in_factor612 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_primary_in_factor616 = new BitSet(new long[]{0x0000000000800202L});
    public static final BitSet FOLLOW_INTEGER_in_primary631 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_primary639 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_array_elem_in_primary647 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_primary655 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_LP_in_primary657 = new BitSet(new long[]{0x0000000100214000L});
    public static final BitSet FOLLOW_argument_list_in_primary659 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_RP_in_primary661 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LP_in_primary680 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_primary683 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_RP_in_primary685 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_expression_in_argument_list699 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_COM_in_argument_list702 = new BitSet(new long[]{0x0000000000214000L});
    public static final BitSet FOLLOW_expression_in_argument_list705 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_print_item_in_print_list726 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_COM_in_print_list729 = new BitSet(new long[]{0x0000000200214000L});
    public static final BitSet FOLLOW_print_item_in_print_list732 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_TEXT_in_print_item747 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_expression_in_print_item755 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_read_item_in_read_list768 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_COM_in_read_list771 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_read_item_in_read_list774 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_IDENT_in_read_item789 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_array_elem_in_read_item797 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_KW_in_declaration811 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_decl_list_in_declaration813 = new BitSet(new long[]{0x0000000000020002L});
    public static final BitSet FOLLOW_decl_item_in_decl_list840 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_COM_in_decl_list843 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_decl_item_in_decl_list846 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_IDENT_in_decl_item861 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_decl_item869 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_LB_in_decl_item871 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_INTEGER_in_decl_item873 = new BitSet(new long[]{0x0000000010000000L});
    public static final BitSet FOLLOW_RB_in_decl_item875 = new BitSet(new long[]{0x0000000000000002L});

}